<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import systemPayLog from '@/api/system/systemPayLog'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'system_pay_log',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: false,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'modal',
    width: 600
  },
  api: systemPayLog.getList,
  export: {
    show: true,
    url: 'system/payLog/export',
    auth: ['system:payLog:export']
  }
})

const columns = reactive([
  {
    title: "ID",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false, 
    commonRules: {
      required: true,
      message: "请输入"
    }
  },
  {
    title: "订单类型",
    dataIndex: "order_type",
    formType: "select",
    search: true,
    commonRules: {
      required: true,
      message: "请输入订单类型"
    }
  },
  {
    title: "支付方式",
    dataIndex: "pay_type",
    formType: "select",
    search: true,
    dict: {
      name: "pay_type",
      props: {
        label: "title",
        value: "key"
      },
      translation: true
    }
  },
  {
    title: "订单号",
    dataIndex: "order_no",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    width:'120px',
    search:true,
    commonRules: {
      required: true,
      message: "请输入订单号"
    }
  },
  {
    title: "第三方单号",
    dataIndex: "pay_no",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    width:'120px',
    search:true,
  },
  
  {
    title: "支付通道",
    dataIndex: "channel_id",
    formType: "input",
    search: false
  },
  {
    title: "订单金额",
    dataIndex: "amount",
    formType: "input",
    search: false
  },
  {
    title: "退款金额",
    dataIndex: "refund_amount",
    formType: "input",
    search: false
  },
  {
    title: "状态",
    dataIndex: "status",
    formType: "select",
    search: true,
    dict: {
      name: "pay_status",
      props: {
        label: "title",
        value: "key"
      },
      translation: true
    }
  },
 
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false, 
    showTime: true,
    width:'120px',
    search:true,
  },
  {
    title: "退款时间",
    dataIndex: "refund_at",
    formType: "date",
    search: false,
    width:'120px',
    showTime: true
  },
  {
    title: "支付时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false, 
    hide:true, 
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true,
    search:false
  },
  {
    title: "关闭时间",
    dataIndex: "expired_at",
    formType: "date",
    search: false,
    hide:true,
    showTime: true
  },
  {
    title: "接口返回信息摘要",
    dataIndex: "message",
    formType: "input",
    width:'100px',
    search: false
  }
])
</script>
<script> export default { name: 'system:payLog' } </script>